package com.design01_builder.pattern05_prototype.shallowcloneanddeepclone;

/**
 * @ClassName ConcretePrototype2
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/3 12:28
 */
public class ConcretePrototype2 implements Cloneable  {

    private Person person;
    public Person getPerson() {
        return person;
    }
    public void setPerson(Person person) {
        this.person = person;
    }
    void show(){
        System.out.println("嫌疑人姓名: " +person.getName());
    }
    public ConcretePrototype2() {
        System.out.println("具体的原型对象创建完成!");
    }


    @Override
    protected ConcretePrototype2 clone() throws CloneNotSupportedException {
        System.out.println("具体的原型对象复制成功!");
        return (ConcretePrototype2)super.clone();
    }

}
